package com.codingapi.auto.deploy.ato;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author modificial
 * @date 2018/7/23
 * @company codingApi
 * @description
 */
@ConfigurationProperties(prefix = "codingapi.server.config")
@Component
public class ServerConfig {
    /**
     * 主机ip
     */
    private  String host;
    /**
     * 主机用户名
     */
    private  String  userName;
    /**
     * 主机密码
     */
    private  String  passWord;
    /**
     * 主机端口号
     */
    private  Integer port;
    /**
     * 脚本位置
     */
    private  String path;
    /**
     * maven测试报告位置
     */
    private  String  html;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public Integer getPort() {
        if(port==null||port<=0){
            setPort(22);
        }
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getHtml() {
        return html;
    }

    public void setHtml(String html) {
        this.html = html;
    }

    @Override
    public String toString() {
        return "ServerConfig{" +
                "host='" + host + '\'' +
                ", userName='" + userName + '\'' +
                ", passWord='" + passWord + '\'' +
                ", port=" + port +
                ", path='" + path + '\'' +
                ", html='" + html + '\'' +
                '}';
    }
}
